<template>
    <div>
      <h1>爷爷组件</h1>
      <hr />
      <!-- 爸爸组件 -->
      <provide-parent></provide-parent>
    </div>
  </template>
  <script setup>
  import ProvideParent from "./ProvideParent.vue";
  import { ref, provide } from "vue";
  const money = ref(1000);
  const updateMoney = (value) => {
    money.value -= value;
  }
  provide("money", money); // 1. 提供的属性名 2. 属性值
  provide("updateMoney", updateMoney);
  </script>